﻿<div ng-controller="consumeItemController">
    <div class="wrapper border-bottom white-bg page-heading">
        <div class="col-lg-pull-12">
            <ol class="breadcrumb">
                <li><a href="javascript:void(0)" ng-click="goBack()">消费</a></li>
                <li class="active" ng-bind="breadcrumb"></li>
            </ol>
        </div>
    </div>
    <form name="_form" class="form-horizontal w5c-form" w5c-form-validate="model.validateOptions" role="form" novalidate>
        <div class="form-group form-group-sm">
            <label class="col-sm-2 control-label">消费标题</label>
            <div class="col-sm-3">
                <input type="text" name="title" class="form-control " ng-model="model.title" ng-maxlength="35" placeholder="请输入消费标题" required>
            </div>
        </div>
        <div class="form-group form-group-sm">
            <label class="col-sm-2 control-label">消费类型</label>
            <div class="col-sm-2">
                <select name="type" class="form-control input-sm" ng-model="model.consume_type_value" required>
                    <option ng-repeat="x in model.e_consume_type_list" value="{{x.value}}">{{x.text}}</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">图片</label>
            <div class="col-sm-10">
                <input name="logo_url" type="file" ngf-select ng-model="model.file" accept="image/*" class="form-control input-sm">
                <img ng-src="{{site.img_url+model.img_url}}" class="img-thumbnail" ng-show="model.img_url" width="60" height="80">
            </div>
        </div>
        <div class="form-group form-group-sm">
            <label class="col-sm-2 control-label">说明</label>
            <div class="col-sm-10">
                <textarea keditor="editConfig" id="ConsumeProduct" name="detail" class="form-control input-sm" ng-model="model.detail" rows="4" w5c-dynamic-element ng-change="textAreaChanged(500)" required></textarea>
                <span ng-show="_form.description.$invalid && !_form.description.$pristine" class="w5c-error">请填写消费说明</span>
                <span class="help-block" id="textcount">0/500</span>
            </div>
        </div>
        <div class="form-group form-group-sm">
            <label class="col-sm-2 control-label">状态</label>
            <div class="col-sm-2">
                <select name="disabled_value" class="form-control input-sm" ng-model="model.disabled_value">
                    <option value="0">正常</option>
                    <option value="1">停用</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">排序</label>
            <div class="col-sm-3">
                <input type="number" name="sort" class="form-control input-sm" ng-model="model.sort" required>
            </div>
        </div>
        <div class="form-group form-group-sm">
            <label class="col-sm-2 control-label">适用于</label>
            <div class="col-sm-2">
                <select name="type" class="form-control input-sm" ng-model="model.apply_value" required>
                    <option ng-repeat="x in model.e_apply_list" value="{{x.value}}">{{x.text}}</option>
                </select>
            </div>
        </div>
        <div class="form-group form-group-sm">
            <label class="col-sm-2 control-label">Url地址</label>
            <div class="col-sm-3">
                <input type="text" name="url" class="form-control" placeholder="请输入跳转Url地址" ng-model="model.url">
            </div>
        </div>
        <div class="form-group form-group-sm">
            <label class="col-sm-2 control-label">是否在AppStore版本中显示</label>
            <div class="col-sm-3">
                <label>
                    <input type="checkbox" name="is_app_store_show" ng-model="model.is_app_store_show">
                </label>
            </div>
        </div>
        <div class="form-group form-group-sm">
            <label class="col-sm-2 control-label"></label>
            <div class="col-sm-3">
                <button ng-if="model.disabled == 1 || model.id == 0" type="submit" w5c-form-submit="save()" class="btn btn-primary btn-sm" btn-loading="psdisabled.save" loading-text="保存中..." ng-disabled="psdisabled.save">
                    <i class="fa fa-save"></i> 保存
                </button>
                <button ng-if="model.disabled == 1" ng-click="goBack()" class="btn btn-primary btn-sm"><i class="fa fa-rotate-left"></i> 取消</button>
                <button ng-if="model.disabled != 1" ng-click="goBack()" class="btn btn-primary btn-sm"><i class="fa fa-rotate-left"></i> 返回</button>
            </div>
        </div>
    </form>
</div>